package expriment3_bag;

public class Sixteen {
    public static void main(String[] args) {
        int[] arr={11,34,47,19,5,87,63,88};
        System.out.println("原数组如下：");
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + "\t");
        }
        System.out.println();
        System.out.println("排序后的数组如下：");
        for (int i = 0; i < arr.length-2; i++) {
            for (int j = 0; j < arr.length - i - 1; j++) {
                if (arr[j] > arr[j + 1]) {
                    int temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }
            }
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + "\t");
        }
    }
}
